Contents
rabbit mq连接失败
1 | ConnectionFactory factory = new ConnectionFactory(); |
1 | "C:\Program Files\java\jdk1.8.0_91\bin\java.exe" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2019.2.4\lib\idea_rt.jar=54668:C:\Program Files\JetBrains\IntelliJ IDEA 2019.2.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\java\jdk1.8.0_91\jre\lib\charsets.jar;C:\Program Files\java\jdk1.8.0_91\jre\lib\deploy.jar;C:\Program Files\java\jdk1.8.0_91\jre\lib\ext\access-bridge-64.jar;C:\Program Files\java\jdk1.8.0_91\jre\lib\ext\cldrdata.jar;C:\Program Files\java\jdk1.8.0_91\jre\lib\ext\dnsns.jar;C:\Program Files\java\jdk1.8.0_91\jre\lib\ext\jaccess.jar;C:\Program Files\java\jdk1.8.0_91\jre\lib\ext\jfxrt.jar;C:\Program Files\java\jdk1.8.0_91\jre\lib\ext\localedata.jar;C:\Program Files\java\jdk1.8.0_91\jre\lib\ext\nashorn.jar;C:\Program Files\java\jdk1.8.0_91\jre\lib\ext\sunec.jar;C:\Program Files\java\jdk1.8.0_91\jre\lib\ext\sunjce_provider.jar;C:\Program Files\java\jdk1.8.0_91\jre\lib\ext\sunmscapi.jar;C:\Program Files\java\jdk1.8.0_91\jre\lib\ext\sunpkcs11.jar;C:\Program Files\java\jdk1.8.0_91\jre\lib\ext\zipfs.jar;C:\Program Files\java\jdk1.8.0_91\jre\lib\javaws.jar;C:\Program Files\java\jdk1.8.0_91\jre\lib\jce.jar;C:\Program Files\java\jdk1.8.0_91\jre\lib\jfr.jar;C:\Program Files\java\jdk1.8.0_91\jre\lib\jfxswt.jar;C:\Program Files\java\jdk1.8.0_91\jre\lib\jsse.jar;C:\Program Files\java\jdk1.8.0_91\jre\lib\management-agent.jar;C:\Program Files\java\jdk1.8.0_91\jre\lib\plugin.jar;C:\Program Files\java\jdk1.8.0_91\jre\lib\resources.jar;C:\Program Files\java\jdk1.8.0_91\jre\lib\rt.jar;D:\study\mq\gupaoedu-vip-rabbitmq-javaapi\target\classes;D:\repository\com\rabbitmq\amqp-client\5.6.0\amqp-client-5.6.0.jar;D:\repository\org\slf4j\slf4j-api\1.7.25\slf4j-api-1.7.25.jar;D:\repository\org\slf4j\slf4j-simple\1.7.25\slf4j-simple-1.7.25.jar" com.gupaoedu.simple.MyConsumer |
代码如1,报错如2
报错原因,rabbit mq的15672为管理端口,使用5672端口即可。
某些情况用15672端口也行